package simportal.persistent;

import java.util.ArrayList;
import java.util.List;

import com.cfuture08.eweb4j.orm.config.annotation.Column;
import com.cfuture08.eweb4j.orm.config.annotation.Id;
import com.cfuture08.eweb4j.orm.config.annotation.Many;
import com.cfuture08.eweb4j.orm.config.annotation.Table;
import com.cfuture08.util.JsonConverter;

/**
 * 操作，Http方法，包括GET、POST、DELETE、GET
 * 持久化對象
 * @author weiwei[l.weiwei@163.com]
 *
 */
@Table("t_Operation")
public class Operation {
	@Id
	@Column("")
	private Integer id;
	@Column("")
	private String name;
	@Column("")
	private String description;
	//操作权限是一对多的关系
	@Many(target=Permission.class,column="operationId")
	private List<Permission> permissions = new ArrayList<Permission>();
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public List<Permission> getPermissions() {
		return permissions;
	}
	public void setPermissions(List<Permission> permissions) {
		this.permissions = permissions;
	}
	
	public String toString(){
		return JsonConverter.convert(this);
	}
}
